Skip to content

Conversation

@lambdalisue
Copy link
Member

@lambdalisue lambdalisue commented Aug 2, 2025

Summary

  • Add deno workspace and import map configuration
  • Update all imports to use import map aliases
  • Fix coverage task to exclude tests and import_map_importer
  • Switch from jsr:@molt/cli to deno outdated for dependency updates

Test plan

  • All existing tests pass
  • Import map correctly resolves all dependencies
  • Coverage task excludes appropriate files
  • deno outdated works for dependency updates

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated all import statements throughout the codebase and tests to use simplified, version-agnostic module specifiers, improving maintainability and consistency.
    • Updated configuration files to reflect new import mappings and workspace settings.
    • Adjusted task definitions and exclusions in the configuration for enhanced development workflow.
  • New Features
    • Added explicit configuration file specification when starting the Deno server.

@coderabbitai
Copy link

coderabbitai bot commented Aug 2, 2025

Warning

Rate limit exceeded

@lambdalisue has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 6 minutes and 1 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between d046c4e and af037ea.

📒 Files selected for processing (69)
  • autoload/denops/_internal/server/proc.vim (2 hunks)
  • deno.jsonc (1 hunks)
  • denops/@denops-private/cli.ts (1 hunks)
  • denops/@denops-private/cli_test.ts (2 hunks)
  • denops/@denops-private/deno.jsonc (1 hunks)
  • denops/@denops-private/denops.ts (1 hunks)
  • denops/@denops-private/denops_test.ts (2 hunks)
  • denops/@denops-private/error.ts (1 hunks)
  • denops/@denops-private/error_test.ts (1 hunks)
  • denops/@denops-private/host.ts (1 hunks)
  • denops/@denops-private/host/nvim.ts (1 hunks)
  • denops/@denops-private/host/nvim_test.ts (1 hunks)
  • denops/@denops-private/host/vim.ts (1 hunks)
  • denops/@denops-private/host/vim_test.ts (1 hunks)
  • denops/@denops-private/host_test.ts (1 hunks)
  • denops/@denops-private/plugin.ts (1 hunks)
  • denops/@denops-private/plugin_test.ts (1 hunks)
  • denops/@denops-private/service.ts (1 hunks)
  • denops/@denops-private/service_test.ts (1 hunks)
  • denops/@denops-private/util.ts (1 hunks)
  • denops/@denops-private/version.ts (1 hunks)
  • denops/@denops-private/version_test.ts (1 hunks)
  • denops/@denops-private/worker.ts (1 hunks)
  • denops/@denops-private/worker_test.ts (1 hunks)
  • tests/denops/runtime/functions/denops/interrupt_test.ts (1 hunks)
  • tests/denops/runtime/functions/denops/notify_test.ts (1 hunks)
  • tests/denops/runtime/functions/denops/request_async_test.ts (1 hunks)
  • tests/denops/runtime/functions/denops/request_test.ts (1 hunks)
  • tests/denops/runtime/functions/plugin/check_type_test.ts (1 hunks)
  • tests/denops/runtime/functions/plugin/discover_test.ts (1 hunks)
  • tests/denops/runtime/functions/plugin/is_loaded_test.ts (1 hunks)
  • tests/denops/runtime/functions/plugin/load_test.ts (1 hunks)
  • tests/denops/runtime/functions/plugin/reload_test.ts (1 hunks)
  • tests/denops/runtime/functions/plugin/unload_test.ts (1 hunks)
  • tests/denops/runtime/functions/plugin/wait_async_test.ts (1 hunks)
  • tests/denops/runtime/functions/plugin/wait_test.ts (1 hunks)
  • tests/denops/runtime/functions/server/close_test.ts (1 hunks)
  • tests/denops/runtime/functions/server/connect_test.ts (1 hunks)
  • tests/denops/runtime/functions/server/start_test.ts (1 hunks)
  • tests/denops/runtime/functions/server/status_test.ts (1 hunks)
  • tests/denops/runtime/functions/server/stop_test.ts (1 hunks)
  • tests/denops/runtime/plugin_test.ts (1 hunks)
  • tests/denops/testdata/dummy_dispatcher_plugin.ts (1 hunks)
  • tests/denops/testdata/dummy_interrupt_plugin.ts (1 hunks)
  • tests/denops/testdata/dummy_invalid_constraint_plugin.ts (1 hunks)
  • tests/denops/testdata/dummy_invalid_constraint_plugin2.ts (1 hunks)
  • tests/denops/testdata/dummy_invalid_dispose_plugin.ts (1 hunks)
  • tests/denops/testdata/dummy_invalid_plugin.ts (1 hunks)
  • tests/denops/testdata/dummy_invalid_wait_plugin.ts (1 hunks)
  • tests/denops/testdata/dummy_plugins/denops/@dummy_namespace/main.ts (1 hunks)
  • tests/denops/testdata/dummy_plugins/denops/dummy.invalid_name/main.ts (1 hunks)
  • tests/denops/testdata/dummy_plugins/denops/dummy_invalid/main.ts (1 hunks)
  • tests/denops/testdata/dummy_plugins/denops/dummy_valid/main.ts (1 hunks)
  • tests/denops/testdata/dummy_valid_dispose_plugin.ts (1 hunks)
  • tests/denops/testdata/dummy_valid_plugin.ts (1 hunks)
  • tests/denops/testdata/dummy_valid_wait_plugin.ts (1 hunks)
  • tests/denops/testdata/resolve.ts (1 hunks)
  • tests/denops/testdata/shared_server_test_no_verbose.ts (1 hunks)
  • tests/denops/testdata/shared_server_test_verbose_true.ts (1 hunks)
  • tests/denops/testdata/with_import_map/plugin_with_import_map.ts (1 hunks)
  • tests/denops/testutil/conf.ts (1 hunks)
  • tests/denops/testutil/conf_test.ts (1 hunks)
  • tests/denops/testutil/mock.ts (1 hunks)
  • tests/denops/testutil/mock_test.ts (1 hunks)
  • tests/denops/testutil/shared_server.ts (1 hunks)
  • tests/denops/testutil/shared_server_test.ts (1 hunks)
  • tests/denops/testutil/wait.ts (1 hunks)
  • tests/denops/testutil/wait_test.ts (1 hunks)
  • tests/denops/testutil/with.ts (1 hunks)

Walkthrough

This change updates import statements across the codebase, removing explicit version specifiers and the "jsr:" prefix from module paths, switching to direct, unversioned package imports. It also introduces and updates Deno configuration files, including new import maps and workspace settings. Additionally, the Deno process is now started with an explicit configuration file.

Changes

Cohort / File(s) Change Summary
Import Path Simplification – Core & Plugin
denops/@denops-private/cli.ts, denops/@denops-private/denops.ts, denops/@denops-private/error.ts, denops/@denops-private/host.ts, denops/@denops-private/host/nvim.ts, denops/@denops-private/host/vim.ts, denops/@denops-private/plugin.ts, denops/@denops-private/service.ts, denops/@denops-private/util.ts, denops/@denops-private/version.ts, denops/@denops-private/worker.ts
Updated import statements to remove "jsr:" prefix and version specifiers, using direct package paths. No logic changes.
Import Path Simplification – Tests
denops/@denops-private/cli_test.ts, denops/@denops-private/denops_test.ts, denops/@denops-private/error_test.ts, denops/@denops-private/host/nvim_test.ts, denops/@denops-private/host/vim_test.ts, denops/@denops-private/host_test.ts, denops/@denops-private/plugin_test.ts, denops/@denops-private/service_test.ts, denops/@denops-private/version_test.ts, denops/@denops-private/worker_test.ts
Updated test imports to use simplified, unversioned module paths. No changes to test logic.
Import Path Simplification – Tests (Project-wide)
tests/denops/runtime/functions/denops/*, tests/denops/runtime/functions/plugin/*, tests/denops/runtime/functions/server/*, tests/denops/runtime/plugin_test.ts, tests/denops/testdata/*, tests/denops/testdata/dummy_plugins/denops/*/main.ts, tests/denops/testutil/*
Updated all test and utility files to use simplified, unversioned import paths. No logic changes.
Deno Configuration Files
deno.jsonc, denops/@denops-private/deno.jsonc
Updated and added Deno configuration files: new workspace, revised tasks, extended imports, and new import map for internal modules.
Deno Process Startup
autoload/denops/_internal/server/proc.vim
Added a constant for the Deno config file and modified server startup to include the --config flag referencing this config.

Sequence Diagram(s)

sequenceDiagram
    participant Vim
    participant ProcVim
    participant Deno

    Vim->>ProcVim: Start server
    ProcVim->>Deno: Spawn Deno process with --config deno.jsonc
    Deno-->>ProcVim: Deno process initialized with config
    ProcVim-->>Vim: Server ready
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

enhancement

Poem

A hop and a skip, imports anew,
The "jsr:" is gone—just clean paths in view!
Configs now guide Deno with care,
While rabbits review with time to spare.
With every import, things look bright—
Simpler, lighter, hopping right! 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch use-import-map-in-denops-itself

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 15

🔭 Outside diff range comments (11)
tests/denops/runtime/functions/plugin/check_type_test.ts (1)

1-5: Fix Prettier failure – collapse multiline import to one line
CI is failing with “Import statements should be in a single line”. Re-format the destructured import accordingly:

-import {
-  assertMatch,
-  assertNotMatch,
-  assertRejects,
-} from "@std/assert";
+import { assertMatch, assertNotMatch, assertRejects } from "@std/assert";

This satisfies the repository’s Prettier rule while keeping the same semantics.

tests/denops/runtime/functions/plugin/load_test.ts (1)

1-6: Fix Prettier-breaking multiline import

CI failed because Prettier expects this import on a single line. Collapsing it satisfies the formatter without touching semantics.

-import {
-  assertEquals,
-  assertMatch,
-  assertRejects,
-} from "@std/assert";
+import { assertEquals, assertMatch, assertRejects } from "@std/assert";
denops/@denops-private/version.ts (1)

22-24: parse() may return null – propagate fallback instead

parse() returns SemVer | null; if it yields null, the function currently violates its declared return type (SemVer | T) and leaks a null value.

-    return parse(decoder.decode(stdout).trim());
+    return parse(decoder.decode(stdout).trim()) ?? fallback;

This preserves type guarantees and avoids surprising nulls.

tests/denops/runtime/functions/plugin/reload_test.ts (1)

1-6: CI is red – Prettier expects this import on one line

GitHub Actions fails with
Prettier formatting check failed. Import statements should be in a single line.
Collapse the multiline import to satisfy the formatter:

-import {
-  assertEquals,
-  assertMatch,
-  assertRejects,
-} from "@std/assert";
+import { assertEquals, assertMatch, assertRejects } from "@std/assert";

No functional behaviour changes; just formatting.

tests/denops/runtime/functions/plugin/discover_test.ts (1)

1-6: CI is red – Prettier flags multiline @std/assert import

Same Prettier error as in reload_test.ts. Flatten the import:

-import {
-  assertArrayIncludes,
-  assertEquals,
-  assertMatch,
-} from "@std/assert";
+import { assertArrayIncludes, assertEquals, assertMatch } from "@std/assert";

After this change the formatting gate should pass.

tests/denops/runtime/functions/plugin/unload_test.ts (1)

1-6: Fix import formatting to pass Prettier checks.

The import path changes from versioned "jsr:" imports to direct package imports are correct and align with the import map approach. However, the multiline import format is causing Prettier formatting failures.

Apply this diff to fix the formatting:

-import {
-  assertEquals,
-  assertMatch,
-  assertRejects,
-} from "@std/assert";
-import { delay } from "@std/async";
+import { assertEquals, assertMatch, assertRejects } from "@std/assert";
+import { delay } from "@std/async";
tests/denops/runtime/functions/server/start_test.ts (1)

1-8: Resolve formatting failure – keep the whole import in one line

Same Prettier error as elsewhere; collapse the @std/assert import list.

-import {
-  assert,
-  assertEquals,
-  assertFalse,
-  assertMatch,
-  assertNotMatch,
-  assertStringIncludes,
-} from "@std/assert";
+import { assert, assertEquals, assertFalse, assertMatch, assertNotMatch, assertStringIncludes } from "@std/assert";
denops/@denops-private/host/nvim_test.ts (1)

1-6: Prettier violation – collapse @std/assert import

-import {
-  assertEquals,
-  assertMatch,
-  assertRejects,
-  assertStringIncludes,
-} from "@std/assert";
+import { assertEquals, assertMatch, assertRejects, assertStringIncludes } from "@std/assert";
tests/denops/runtime/functions/server/close_test.ts (1)

1-6: Prettier violation – collapse @std/assert import

-import {
-  assert,
-  assertEquals,
-  assertMatch,
-  assertRejects,
-} from "@std/assert";
+import { assert, assertEquals, assertMatch, assertRejects } from "@std/assert";
denops/@denops-private/host/vim_test.ts (1)

1-15: Fix Prettier formatting for import statements.

The import path updates are correct and follow the proper import map migration pattern, but there's a formatting issue that needs to be addressed.

Apply this formatting fix for the import statement on lines 1-5:

-import {
-  assertEquals,
-  assertMatch,
-  assertRejects,
-} from "@std/assert";
+import { assertEquals, assertMatch, assertRejects } from "@std/assert";
denops/@denops-private/plugin_test.ts (1)

1-14: Fix Prettier-blocking multiline import blocks

The CI fails because each import must be a single-line statement.
Refactor the two multiline blocks at Lines 1-7 and 8-13:

-import {
-  assert,
-  assertEquals,
-  assertInstanceOf,
-  assertRejects,
-  assertStringIncludes,
-} from "@std/assert";
+import { assert, assertEquals, assertInstanceOf, assertRejects, assertStringIncludes } from "@std/assert";

-import {
-  assertSpyCall,
-  assertSpyCalls,
-  spy,
-  stub,
-} from "@std/testing/mock";
+import { assertSpyCall, assertSpyCalls, spy, stub } from "@std/testing/mock";
♻️ Duplicate comments (3)
tests/denops/testdata/dummy_plugins/denops/dummy_valid/main.ts (1)

1-1: Same import-map prerequisite as noted above

The comment on @denops/core mapping equally applies here.

tests/denops/testdata/dummy_invalid_plugin.ts (1)

1-1: Same import-map prerequisite as noted above

The comment on @denops/core mapping equally applies here.

tests/denops/runtime/functions/plugin/is_loaded_test.ts (1)

1-2: Same delay re-export caveat as in wait_test.ts

delay is imported from the root @std/async package. Please ensure it is
re-exported there (or switch to @std/async/delay for clarity).

🧹 Nitpick comments (4)
denops/@denops-private/error.ts (1)

1-7: Same alias-resolution caveat as above

@core/unknownutil/* and @core/errorutil must also be present in the import map or deno cache will break.

If you already verified the mappings for host.ts, extend that check to include:

@core/errorutil
tests/denops/testutil/wait.ts (1)

6-13: Doc comment’s default timeout is out of sync with constant

DEFAULT_TIMEOUT is 30_000, but the JSDoc still says @default {10_000}.
Keeping them aligned avoids confusion.

-   * @default {10_000}
+   * @default {30_000}
tests/denops/runtime/plugin_test.ts (1)

1-2: Minor style inconsistency in delay import

Here delay is brought in via the sub-module @std/async/delay, whereas other tests (wait_async_test.ts) rely on the barrel export @std/async.
For consistency across the suite consider using a single form (prefer the barrel import unless tree-shaking size is a concern).

tests/denops/runtime/functions/plugin/wait_async_test.ts (1)

6-7: Keep delay import form consistent

delay is imported from the barrel module @std/async here, while other tests use @std/async/delay. Aligning on one form will avoid accidental duplication in future lock-files.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 29e830d and 30a1917.

📒 Files selected for processing (69)
  • autoload/denops/_internal/server/proc.vim (2 hunks)
  • deno.jsonc (1 hunks)
  • denops/@denops-private/cli.ts (1 hunks)
  • denops/@denops-private/cli_test.ts (2 hunks)
  • denops/@denops-private/deno.jsonc (1 hunks)
  • denops/@denops-private/denops.ts (1 hunks)
  • denops/@denops-private/denops_test.ts (2 hunks)
  • denops/@denops-private/error.ts (1 hunks)
  • denops/@denops-private/error_test.ts (1 hunks)
  • denops/@denops-private/host.ts (1 hunks)
  • denops/@denops-private/host/nvim.ts (1 hunks)
  • denops/@denops-private/host/nvim_test.ts (1 hunks)
  • denops/@denops-private/host/vim.ts (1 hunks)
  • denops/@denops-private/host/vim_test.ts (1 hunks)
  • denops/@denops-private/host_test.ts (1 hunks)
  • denops/@denops-private/plugin.ts (1 hunks)
  • denops/@denops-private/plugin_test.ts (1 hunks)
  • denops/@denops-private/service.ts (1 hunks)
  • denops/@denops-private/service_test.ts (1 hunks)
  • denops/@denops-private/util.ts (1 hunks)
  • denops/@denops-private/version.ts (1 hunks)
  • denops/@denops-private/version_test.ts (1 hunks)
  • denops/@denops-private/worker.ts (1 hunks)
  • denops/@denops-private/worker_test.ts (1 hunks)
  • tests/denops/runtime/functions/denops/interrupt_test.ts (1 hunks)
  • tests/denops/runtime/functions/denops/notify_test.ts (1 hunks)
  • tests/denops/runtime/functions/denops/request_async_test.ts (1 hunks)
  • tests/denops/runtime/functions/denops/request_test.ts (1 hunks)
  • tests/denops/runtime/functions/plugin/check_type_test.ts (1 hunks)
  • tests/denops/runtime/functions/plugin/discover_test.ts (1 hunks)
  • tests/denops/runtime/functions/plugin/is_loaded_test.ts (1 hunks)
  • tests/denops/runtime/functions/plugin/load_test.ts (1 hunks)
  • tests/denops/runtime/functions/plugin/reload_test.ts (1 hunks)
  • tests/denops/runtime/functions/plugin/unload_test.ts (1 hunks)
  • tests/denops/runtime/functions/plugin/wait_async_test.ts (1 hunks)
  • tests/denops/runtime/functions/plugin/wait_test.ts (1 hunks)
  • tests/denops/runtime/functions/server/close_test.ts (1 hunks)
  • tests/denops/runtime/functions/server/connect_test.ts (1 hunks)
  • tests/denops/runtime/functions/server/start_test.ts (1 hunks)
  • tests/denops/runtime/functions/server/status_test.ts (1 hunks)
  • tests/denops/runtime/functions/server/stop_test.ts (1 hunks)
  • tests/denops/runtime/plugin_test.ts (1 hunks)
  • tests/denops/testdata/dummy_dispatcher_plugin.ts (1 hunks)
  • tests/denops/testdata/dummy_interrupt_plugin.ts (1 hunks)
  • tests/denops/testdata/dummy_invalid_constraint_plugin.ts (1 hunks)
  • tests/denops/testdata/dummy_invalid_constraint_plugin2.ts (1 hunks)
  • tests/denops/testdata/dummy_invalid_dispose_plugin.ts (1 hunks)
  • tests/denops/testdata/dummy_invalid_plugin.ts (1 hunks)
  • tests/denops/testdata/dummy_invalid_wait_plugin.ts (1 hunks)
  • tests/denops/testdata/dummy_plugins/denops/@dummy_namespace/main.ts (1 hunks)
  • tests/denops/testdata/dummy_plugins/denops/dummy.invalid_name/main.ts (1 hunks)
  • tests/denops/testdata/dummy_plugins/denops/dummy_invalid/main.ts (1 hunks)
  • tests/denops/testdata/dummy_plugins/denops/dummy_valid/main.ts (1 hunks)
  • tests/denops/testdata/dummy_valid_dispose_plugin.ts (1 hunks)
  • tests/denops/testdata/dummy_valid_plugin.ts (1 hunks)
  • tests/denops/testdata/dummy_valid_wait_plugin.ts (1 hunks)
  • tests/denops/testdata/resolve.ts (1 hunks)
  • tests/denops/testdata/shared_server_test_no_verbose.ts (1 hunks)
  • tests/denops/testdata/shared_server_test_verbose_true.ts (1 hunks)
  • tests/denops/testdata/with_import_map/plugin_with_import_map.ts (1 hunks)
  • tests/denops/testutil/conf.ts (1 hunks)
  • tests/denops/testutil/conf_test.ts (1 hunks)
  • tests/denops/testutil/mock.ts (1 hunks)
  • tests/denops/testutil/mock_test.ts (1 hunks)
  • tests/denops/testutil/shared_server.ts (1 hunks)
  • tests/denops/testutil/shared_server_test.ts (1 hunks)
  • tests/denops/testutil/wait.ts (1 hunks)
  • tests/denops/testutil/wait_test.ts (1 hunks)
  • tests/denops/testutil/with.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: Milly
PR: vim-denops/denops.vim#418
File: tests/denops/runtime/functions/plugin/check_type_test.ts:6-6
Timestamp: 2024-09-14T17:09:30.174Z
Learning: In this project, import paths prefixed with `/denops-testdata/` are defined in `deno.jsonc` via an import map, and these import paths are valid.
📚 Learning: in this project, import paths prefixed with `/denops-testdata/` are defined in `deno.jsonc` via an i...
Learnt from: Milly
PR: vim-denops/denops.vim#418
File: tests/denops/runtime/functions/plugin/check_type_test.ts:6-6
Timestamp: 2024-09-14T17:09:30.174Z
Learning: In this project, import paths prefixed with `/denops-testdata/` are defined in `deno.jsonc` via an import map, and these import paths are valid.

Applied to files:

  • tests/denops/testdata/dummy_invalid_constraint_plugin.ts
  • tests/denops/testdata/dummy_invalid_wait_plugin.ts
  • tests/denops/testdata/dummy_valid_dispose_plugin.ts
  • tests/denops/testdata/resolve.ts
  • tests/denops/testutil/conf_test.ts
  • tests/denops/testutil/conf.ts
  • tests/denops/runtime/functions/plugin/load_test.ts
  • tests/denops/runtime/functions/plugin/check_type_test.ts
  • tests/denops/testdata/dummy_invalid_constraint_plugin2.ts
  • tests/denops/testdata/dummy_invalid_plugin.ts
  • tests/denops/testdata/dummy_plugins/denops/dummy.invalid_name/main.ts
  • denops/@denops-private/host_test.ts
  • tests/denops/testutil/mock.ts
  • denops/@denops-private/util.ts
  • tests/denops/testdata/dummy_plugins/denops/dummy_valid/main.ts
  • tests/denops/testdata/dummy_plugins/denops/dummy_invalid/main.ts
  • tests/denops/runtime/functions/server/status_test.ts
  • tests/denops/runtime/functions/plugin/wait_test.ts
  • tests/denops/testdata/dummy_dispatcher_plugin.ts
  • denops/@denops-private/host/nvim_test.ts
  • denops/@denops-private/plugin.ts
  • tests/denops/runtime/functions/denops/interrupt_test.ts
  • denops/@denops-private/host/vim.ts
  • tests/denops/runtime/functions/server/close_test.ts
  • tests/denops/runtime/functions/denops/notify_test.ts
  • denops/@denops-private/deno.jsonc
  • tests/denops/testdata/dummy_interrupt_plugin.ts
  • tests/denops/testdata/dummy_valid_plugin.ts
  • tests/denops/testdata/shared_server_test_verbose_true.ts
  • tests/denops/testdata/dummy_invalid_dispose_plugin.ts
  • tests/denops/testdata/with_import_map/plugin_with_import_map.ts
  • tests/denops/testutil/shared_server.ts
  • tests/denops/testdata/dummy_plugins/denops/@dummy_namespace/main.ts
  • tests/denops/runtime/functions/plugin/wait_async_test.ts
  • denops/@denops-private/cli.ts
  • tests/denops/testdata/dummy_valid_wait_plugin.ts
  • denops/@denops-private/host.ts
  • tests/denops/runtime/functions/server/start_test.ts
  • tests/denops/testdata/shared_server_test_no_verbose.ts
  • tests/denops/testutil/mock_test.ts
  • denops/@denops-private/denops_test.ts
  • denops/@denops-private/error_test.ts
  • denops/@denops-private/version_test.ts
  • denops/@denops-private/plugin_test.ts
  • tests/denops/testutil/wait.ts
  • denops/@denops-private/error.ts
  • denops/@denops-private/worker_test.ts
  • tests/denops/runtime/functions/server/connect_test.ts
  • denops/@denops-private/cli_test.ts
  • tests/denops/runtime/functions/plugin/unload_test.ts
  • denops/@denops-private/version.ts
  • tests/denops/runtime/functions/plugin/reload_test.ts
  • tests/denops/runtime/functions/denops/request_test.ts
  • tests/denops/runtime/plugin_test.ts
  • tests/denops/runtime/functions/server/stop_test.ts
  • denops/@denops-private/service_test.ts
  • denops/@denops-private/denops.ts
  • denops/@denops-private/host/vim_test.ts
  • tests/denops/runtime/functions/plugin/is_loaded_test.ts
  • tests/denops/testutil/with.ts
  • tests/denops/testutil/wait_test.ts
  • tests/denops/runtime/functions/denops/request_async_test.ts
  • autoload/denops/_internal/server/proc.vim
  • denops/@denops-private/service.ts
  • tests/denops/runtime/functions/plugin/discover_test.ts
  • denops/@denops-private/host/nvim.ts
  • tests/denops/testutil/shared_server_test.ts
  • denops/@denops-private/worker.ts
  • deno.jsonc
📚 Learning: in the `denops/@denops-private/service.ts` file, initializing properties like `#loadedwaiter` in the...
Learnt from: lambdalisue
PR: vim-denops/denops.vim#344
File: denops/@denops-private/service.ts:183-183
Timestamp: 2024-07-08T01:52:22.851Z
Learning: In the `denops/@denops-private/service.ts` file, initializing properties like `#loadedWaiter` in the constructor is a common and acceptable pattern.

Applied to files:

  • tests/denops/testdata/dummy_invalid_wait_plugin.ts
  • tests/denops/testdata/dummy_dispatcher_plugin.ts
  • tests/denops/testdata/shared_server_test_verbose_true.ts
  • tests/denops/testdata/dummy_valid_wait_plugin.ts
  • tests/denops/testdata/shared_server_test_no_verbose.ts
  • denops/@denops-private/denops.ts
  • denops/@denops-private/service.ts
📚 Learning: `neovim` and `vim` from `../host/nvim.ts` and `../host/vim.ts` are classes and should be imported no...
Learnt from: Milly
PR: vim-denops/denops.vim#352
File: denops/@denops-private/testutil/host.ts:3-4
Timestamp: 2024-07-27T10:03:47.237Z
Learning: `Neovim` and `Vim` from `../host/nvim.ts` and `../host/vim.ts` are classes and should be imported normally if they are instantiated in the code.

Applied to files:

  • denops/@denops-private/host/nvim_test.ts
  • denops/@denops-private/host/vim.ts
  • denops/@denops-private/host.ts
  • denops/@denops-private/worker_test.ts
  • denops/@denops-private/host/vim_test.ts
  • denops/@denops-private/service.ts
  • denops/@denops-private/host/nvim.ts
  • denops/@denops-private/worker.ts
📚 Learning: in the denops.vim project, the `denops#plugin#unload()` function is designed to throw exceptions to ...
Learnt from: Milly
PR: vim-denops/denops.vim#385
File: autoload/denops/plugin.vim:56-58
Timestamp: 2024-07-05T15:37:46.867Z
Learning: In the Denops.vim project, the `denops#plugin#unload()` function is designed to throw exceptions to the caller, who is responsible for handling them.

Applied to files:

  • denops/@denops-private/plugin.ts
  • denops/@denops-private/host/vim.ts
📚 Learning: the `denops#_internal#server#chan#notify` function is designed to throw an error in case of an inval...
Learnt from: Milly
PR: vim-denops/denops.vim#335
File: autoload/denops/plugin.vim:73-75
Timestamp: 2024-07-27T10:03:47.237Z
Learning: The `denops#_internal#server#chan#notify` function is designed to throw an error in case of an invalid state, such as when the channel is `v:null`.

Applied to files:

  • denops/@denops-private/host/vim.ts
  • tests/denops/runtime/functions/denops/notify_test.ts
📚 Learning: the `emit` function in the denops plugin system catches and logs errors internally, ensuring it does...
Learnt from: Milly
PR: vim-denops/denops.vim#335
File: denops/@denops-private/service.ts:245-259
Timestamp: 2024-07-27T10:03:47.237Z
Learning: The `emit` function in the Denops plugin system catches and logs errors internally, ensuring it does not throw errors to the caller.

Applied to files:

  • denops/@denops-private/service.ts
🪛 GitHub Actions: Test
tests/denops/runtime/functions/plugin/load_test.ts

[error] 1-5: Prettier formatting check failed. Import statements should be in a single line.

tests/denops/runtime/functions/plugin/check_type_test.ts

[error] 1-5: Prettier formatting check failed. Import statements should be in a single line.

denops/@denops-private/host_test.ts

[error] 2-6: Prettier formatting check failed. Import statements should be in a single line.

denops/@denops-private/host/vim.ts

[error] 7-11: Prettier formatting check failed. Import statements should be in a single line.

tests/denops/runtime/functions/server/close_test.ts

[error] 1-6: Prettier formatting check failed. Import statements should be in a single line.

denops/@denops-private/deno.jsonc

[error] 13-34: Prettier formatting check failed. Found trailing commas that should be removed.


[error] 17-18: Prettier formatting check failed. Found trailing commas that should be removed.

tests/denops/testutil/mock_test.ts

[error] 15-20: Prettier formatting check failed. Import statements should be in a single line.

denops/@denops-private/plugin_test.ts

[error] 8-13: Prettier formatting check failed. Import statements should be in a single line.

denops/@denops-private/worker_test.ts

[error] 9-14: Prettier formatting check failed. Import statements should be in a single line.

tests/denops/runtime/functions/plugin/unload_test.ts

[error] 1-5: Prettier formatting check failed. Import statements should be in a single line.

tests/denops/runtime/functions/plugin/reload_test.ts

[error] 1-5: Prettier formatting check failed. Import statements should be in a single line.

denops/@denops-private/host/vim_test.ts

[error] 1-5: Prettier formatting check failed. Import statements should be in a single line.

tests/denops/runtime/functions/plugin/discover_test.ts

[error] 1-5: Prettier formatting check failed. Import statements should be in a single line.

deno.jsonc

[error] 13-34: Prettier formatting check failed. Found trailing commas that should be removed.


[error] 17-18: Prettier formatting check failed. Found trailing commas that should be removed.

🔇 Additional comments (40)
tests/denops/runtime/functions/server/status_test.ts (1)

1-1: Import path change looks good

Switching to the bare specifier @std/assert aligns with the new import-map strategy.
No further action required.

tests/denops/runtime/functions/denops/request_async_test.ts (1)

1-6: Consistent with import-map migration

The assertion utilities now come from @std/assert, matching the rest of the codebase.
LGTM.

tests/denops/testdata/dummy_plugins/denops/dummy.invalid_name/main.ts (1)

1-1: Entrypoint import updated correctly

The switch to @denops/core is consistent with the new mapping. No issues found.

tests/denops/testdata/dummy_invalid_constraint_plugin.ts (1)

1-1: Import path modernised

@denops/core specifier aligns with project-wide changes. Looks good.

tests/denops/testdata/shared_server_test_no_verbose.ts (1)

1-1: Ensure @std/async/delay resolves to a pinned std version

Switching to the @std/async/delay alias is fine, but std APIs can introduce breaking changes between minor versions.
Confirm that the import map pins @std/* to a concrete version (e.g. https://deno.land/[email protected]/) rather than the moving latest tag, otherwise future deno test runs may break unexpectedly.

tests/denops/runtime/functions/denops/interrupt_test.ts (1)

1-1: Lock the @std/assert alias to a specific std release

assert/assertEquals occasionally change behaviour (e.g. diff formatting) across std releases.
Pin the alias in your import map the same way you pin other std modules to keep test output deterministic.

tests/denops/testutil/conf_test.ts (1)

1-1: Same concern: make sure @std/assert in the import map is version-pinned

Applies here as well—un-pinned std imports can silently pull in breaking updates.

tests/denops/testdata/dummy_invalid_dispose_plugin.ts (1)

1-1: Import-map alias looks correct – no further changes required
Switching to @denops/core matches the new import-map scheme and keeps the file self-contained.

tests/denops/testdata/dummy_plugins/denops/@dummy_namespace/main.ts (1)

1-1: LGTM on updated import path
The alias @denops/core should resolve via the workspace import map; nothing else changed.

tests/denops/testdata/dummy_valid_plugin.ts (1)

1-1: Import alias update is fine
No behavioural changes introduced; import map will resolve the new specifier.

tests/denops/testdata/shared_server_test_verbose_true.ts (1)

1-1: Alias switch acknowledged
@std/async/delay is the correct import-map target; test logic unchanged.

tests/denops/testdata/dummy_valid_dispose_plugin.ts (1)

1-1: Import map for @denops/core confirmed
The deno.jsonc import map already includes

"@denops/core": "jsr:@denops/core@^7.0.0",

so the bare specifier will resolve correctly in tests. No further changes required.

tests/denops/testdata/dummy_plugins/denops/dummy_invalid/main.ts (1)

1-1: Alias looks fine – just ensure it resolves under all task runners

@denops/core is now resolved via the import map. As long as every deno test/deno task invocation passes --config deno.jsonc (or the workspace’s default), this change is good.

tests/denops/testdata/dummy_valid_wait_plugin.ts (1)

1-2: LGTM – import-map aliasing only
Nothing else changed; behaviour is identical.

tests/denops/testutil/conf.ts (1)

1-3: Imports updated correctly

Path helpers are now brought in via the import map. No functional impact; the rest of the file already guards Windows paths with removeTrailingSep.

tests/denops/testutil/mock.ts (1)

1-2: Consistent aliasing, no behavioural change

Switching to @std/assert & @denops/core keeps typings intact and removes the jsr: prefix. Looks good.

tests/denops/testdata/dummy_invalid_wait_plugin.ts (1)

1-2: Import-map dependency check

Ensure @denops/core and @std/async/delay are mapped; otherwise this test-data plugin won’t build.

tests/denops/testutil/with.ts (1)

1-2: Verify new stream-utility aliases

Bare specifiers @core/streamutil and @milly/streams/transform/tap require import-map entries. Missing mappings will surface only at test run time.

denops/@denops-private/version.ts (1)

1-4: Alias mapping check for std modules

@std/path/* and @std/semver/* must be present in the import map. Unlike third-party packages, these std aliases are not provided by Deno automatically when using an import map.

tests/denops/runtime/functions/plugin/wait_test.ts (1)

8-9: Manual verification needed: ensure @std/async actually exports delay
I wasn’t able to locate an import-map entry for @std/ in deno.jsonc, so please confirm the following before shipping:

  • In deno.jsonc (or your import-map file), that "@std/" is mapped to the correct https://deno.land/std@…/ URL.
  • That the remote async/mod.ts (e.g. https://deno.land/std@…/async/mod.ts) contains an export for delay (either directly or via export * from "./delay.ts").

If you can’t guarantee the stable re-export of delay, switch your imports to the explicit sub-path:

- import { delay } from "@std/async";
+ import { delay } from "@std/async/delay.ts";
denops/@denops-private/error_test.ts (1)

1-2: Imports look good with import-map aliases

The alias switch is clean and consistent with the new deno.jsonc. No further
concerns here.

denops/@denops-private/version_test.ts (1)

1-8: Verify that the new short-form imports are pinned via the import-map

Moving from fully-qualified URLs to bare specifiers (@std/assert, @core/unknownutil/*, …) is fine as long as deno.jsonc (or import_map.json) maps every specifier to an exact version. Otherwise the project will silently float to newer std / unknownutil releases and tests may break reproducibly.

Please double-check that every alias introduced here is present in the import-map with an explicit version (or lock-file), and that deno task vendor / deno cache --lock are part of CI.

tests/denops/runtime/functions/denops/request_test.ts (1)

1-6: LGTM – import specifier update only

The import has been aligned with the new import-map style and no CI warnings are reported for this file.

tests/denops/runtime/functions/denops/notify_test.ts (1)

1-2: LGTM – specifier switch looks correct

@std/assert and @std/async/delay resolve fine through the import-map; no further action needed.

denops/@denops-private/denops.ts (1)

7-11: LGTM! Import paths correctly updated for import map usage.

The transition from versioned "jsr:" imports to direct package imports is clean and consistent with the PR objective to use import maps. The formatting is already correct and no functional changes were made.

tests/denops/testutil/shared_server.ts (1)

1-5: LGTM! Clean import path updates.

All import statements have been correctly updated to use direct package imports without version specifiers, aligning with the import map approach. The formatting is proper and no functional changes were introduced.

denops/@denops-private/plugin.ts (2)

1-1: LGTM! Import path correctly simplified.

The import from "@denops/core" has been properly updated to remove version constraints, consistent with the import map approach.


6-10: LGTM! All import paths properly updated.

All imports have been successfully converted from versioned "jsr:" format to direct package imports, maintaining consistency with the import map refactoring across the codebase.

tests/denops/runtime/functions/server/stop_test.ts (1)

6-7: LGTM! Import statements properly updated.

Both import statements have been correctly updated to use direct package imports without version specifiers, aligning with the import map approach. The formatting is already correct.

tests/denops/testutil/wait_test.ts (1)

1-8: Import-map migration looks good

The switch to @std/assert, @std/testing/mock, and @std/testing/time matches the new import-map aliases. No further action needed.

denops/@denops-private/host/vim.ts (1)

1-6: Alias switch verified

The unknownutil alias imports resolve through the new import-map and compile fine. No issues spotted.

denops/@denops-private/denops_test.ts (1)

1-18: Imports migrated correctly

All std/core/jsr specifiers have been converted to the new aliases and match the workspace import-map. Test logic remains untouched.

tests/denops/runtime/functions/server/connect_test.ts (1)

7-9: Verify new aliases are present in the import map

All imports now rely on @std/*, @nick/*, etc. Please make sure these keys exist in deno.jsonc/import_map.json and that the CI executes deno test with --config=deno.jsonc so the resolver locates them.

denops/@denops-private/service.ts (1)

1-2: Import-map migration LGTM

The switch to @denops/core and @core/errorutil via the map is consistent and poses no functional risk.

denops/@denops-private/cli.ts (1)

4-7: Imports updated correctly

Aliases for workerio, deadline, parseArgs, and asyncSignal look consistent with the new import-map scheme.

tests/denops/testdata/dummy_interrupt_plugin.ts (1)

1-2: Imports align with project-wide alias change

Nothing else to flag here.

denops/@denops-private/worker.ts (1)

7-11: Worker-side aliases updated correctly

The worker now depends on mapped aliases only—looks good.

tests/denops/testutil/shared_server_test.ts (1)

7-9: LGTM! Import map migration looks correct.

The import statements have been successfully updated to use the simplified paths without "jsr:" prefixes and explicit version specifiers, which aligns with the PR objectives of utilizing import map aliases.

denops/@denops-private/service_test.ts (1)

13-24: LGTM! Comprehensive import map migration completed.

All import statements have been correctly updated to use simplified paths without "jsr:" prefixes and version specifiers. The changes are consistent with the project-wide migration to import map usage.

denops/@denops-private/host/nvim.ts (1)

1-8: LGTM! Import map migration completed correctly.

All import statements have been successfully updated to use simplified paths without "jsr:" prefixes and explicit version specifiers. The changes include both @core utility functions and the messagepack-rpc package, all properly migrated to use import map aliases.

Comment on lines 5 to +10
import {
assertEquals,
assertMatch,
assertNotMatch,
assertStringIncludes,
} from "jsr:@std/assert@^1.0.1";
} from "@std/assert";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Collapse multiline imports to restore formatter compliance

Same Prettier rule applies here – keep imports on one line.

-import {
-  assertEquals,
-  assertMatch,
-  assertNotMatch,
-  assertStringIncludes,
-} from "@std/assert";
+import { assertEquals, assertMatch, assertNotMatch, assertStringIncludes } from "@std/assert";

-import {
-  assertSpyCallArgs,
-  assertSpyCalls,
-  resolvesNext,
-  returnsNext,
-  spy,
-  type Stub,
-  stub,
-} from "@std/testing/mock";
+import { assertSpyCallArgs, assertSpyCalls, resolvesNext, returnsNext, spy, type Stub, stub } from "@std/testing/mock";

Also applies to: 12-19

🤖 Prompt for AI Agents
In denops/@denops-private/cli_test.ts between lines 5 and 10 (and also lines 12
to 19), the multiline import statements violate the Prettier formatting rules.
Collapse these multiline imports into single-line imports to restore formatter
compliance, ensuring all imported items from the same module are listed on one
line.

Comment on lines +1 to +2
import { delay } from "@std/async/delay";
import type { Entrypoint } from "@denops/core";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify both @std/async/delay and @denops/core are present in the import map

Two bare specifiers were introduced. Make sure they are registered so the plugin loads during tests.


🏁 Script executed:

#!/bin/bash
IMPORT_MAP=$(jq -r '.importMap' deno.jsonc)
for pkg in '@std/async/delay' '@denops/core'; do
  rg -n "\"$pkg\"" "$IMPORT_MAP" || echo "$pkg not found in import map"
done

Length of output: 528


🏁 Script executed:

#!/bin/bash
echo "Searching for importMap entry in deno.jsonc"
rg -n '"importMap"' deno.jsonc || true

Length of output: 136


🏁 Script executed:

#!/bin/bash
for pkg in '@std/async/delay' '@denops/core'; do
  echo "Searching for $pkg in deno.jsonc"
  rg -n "$pkg" deno.jsonc || echo "$pkg not found in deno.jsonc"
done

Length of output: 496


Add missing @std/async/delay entry to the import map

We verified that one of the new bare-specifier imports is not yet registered:

@denops/core is already mapped in deno.jsonc (line 26):
"@denops/core": "jsr:@denops/core@^7.0.0",
@std/async/delay is not found in deno.jsonc

Please add an entry for @std/async/delay under the imports section of your import map in deno.jsonc, for example:

{
  //
  "imports": {
    "@std/async/delay": "https://deno.land/std@<std-version>/async/delay.ts",
    "@denops/core":     "jsr:@denops/core@^7.0.0",
    //
  }
}

This will ensure that import { delay } from "@std/async/delay"; resolves correctly in your tests.

🤖 Prompt for AI Agents
In tests/denops/testdata/dummy_dispatcher_plugin.ts at lines 1-2, the import of
"@std/async/delay" is missing a corresponding entry in the deno.jsonc import
map. To fix this, add an entry for "@std/async/delay" under the "imports"
section in deno.jsonc, mapping it to the correct URL with the appropriate std
version, for example: "@std/async/delay":
"https://deno.land/std@<std-version>/async/delay.ts". This will ensure the
import resolves correctly during tests.

@@ -1,4 +1,4 @@
import type { Entrypoint } from "jsr:@denops/core@^7.0.0";
import type { Entrypoint } from "@denops/core";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify that @denops/core is declared in the import map

The old jsr: specifier has been dropped, so this file now depends on an alias called @denops/core.
Please double-check that the project-level import map (deno.jsonc or import_map.json) includes:

{
  "imports": {
    "@denops/core": "https://deno.land/x/denops_core@<version>/mod.ts"
  }
}

If the alias is missing the test will fail at load-time.
Run the script below from the repo root to confirm all required aliases are present:


🏁 Script executed:

#!/bin/bash
# List expected aliases and grep them in the import-map files
for a in '@denops/core'; do
  grep -R --line-number --color "$a" $(fd -e json -e jsonc -I import_map) || \
    echo "⚠️  Alias $a not found"
done

Length of output: 291


Add missing @denops/core alias in import maps

The import map under tests/denops/testdata/with_import_map does not include the @denops/core entry, so any import from that specifier will fail at load-time. Please update both import_map.json and import_map.jsonc in that directory (and, if you rely on a project-level import map, your deno.jsonc or import_map.json at the repo root) to include:

 {
   "imports": {
+    "@denops/core": "https://deno.land/x/denops_core@<version>/mod.ts",
     // …other aliases
   }
 }

• Files to update:

  • tests/denops/testdata/with_import_map/import_map.json
  • tests/denops/testdata/with_import_map/import_map.jsonc
  • (optional) deno.jsonc or import_map.json at project root

Verify the alias is present with:

grep -R "@denops/core" deno.jsonc import_map.json tests/denops/testdata/with_import_map/import_map.*

Then rerun your tests to confirm the import loads correctly.

🤖 Prompt for AI Agents
In tests/denops/testdata/dummy_invalid_constraint_plugin2.ts at line 1, the
import of '@denops/core' will fail because the import maps lack an alias for
'@denops/core'. To fix this, add an entry mapping '@denops/core' to the correct
path in the import_map.json and import_map.jsonc files located in
tests/denops/testdata/with_import_map, and also update the project-level import
map file (deno.jsonc or import_map.json) if used. After updating, verify the
alias is present using the provided grep command and rerun tests to ensure the
import resolves correctly.

Comment on lines +1 to 2
import type { Entrypoint } from "@denops/core";
import { getMessage, greeting } from "@test/helper";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Check that all new shorthand aliases exist (@denops/core, @test/helper)

Both aliases must be declared in the workspace import map; otherwise plugin loading will crash at runtime.
You can extend the earlier verification script with extra expected identifiers:


🏁 Script executed:

#!/bin/bash
for a in '@denops/core' '@test/helper' '@std/async' '@std/assert'; do
  grep -R --line-number --color "$a" $(fd -e json -e jsonc -I import_map) || \
    echo "⚠️  Alias $a not found"
done

Length of output: 1432


To confirm which aliases this test actually needs, let’s inspect the entire import block in plugin_with_import_map.ts:


🏁 Script executed:

#!/bin/bash
# Show the first 20 lines of the test file to see all imports
cat tests/denops/testdata/with_import_map/plugin_with_import_map.ts | sed -n '1,20p'

Length of output: 478


Ensure the import map includes every alias used by plugin_with_import_map.ts

The test file imports:

  • @denops/core
  • @test/helper

Currently, in tests/denops/testdata/with_import_map/import_map.json (and .jsonc), only @test/helper is defined. You’ll need to add a mapping for @denops/core so that the plugin can resolve it at runtime. For example:

--- tests/denops/testdata/with_import_map/import_map.json
+++ tests/denops/testdata/with_import_map/import_map.json
@@ "imports": {
-  "@test/helper": "./helper.ts"
+  "@denops/core": "https://denops.land/x/denops/core/mod.ts",
+  "@test/helper": "./helper.ts"
 }

(Adjust the right‐hand path/URL to match your project’s entry point for @denops/core.)

You can verify both aliases with:

for a in '@denops/core' '@test/helper'; do
  grep -R --line-number "$a" tests/denops/testdata/with_import_map/import_map.{json,jsonc} \
    || echo "⚠️  Alias $a not found"
done
🤖 Prompt for AI Agents
In tests/denops/testdata/with_import_map/plugin_with_import_map.ts at lines 1-2,
the file imports both '@denops/core' and '@test/helper', but the import map in
tests/denops/testdata/with_import_map/import_map.json (and .jsonc) only defines
'@test/helper'. To fix this, add an entry for '@denops/core' in the import map
files, mapping it to the correct path or URL for the '@denops/core' package in
your project. Verify both aliases are present by searching the import map files
as suggested.

@lambdalisue lambdalisue force-pushed the use-import-map-in-denops-itself branch 2 times, most recently from 9261af6 to 6c12579 Compare August 2, 2025 13:16
@codecov
Copy link

codecov bot commented Aug 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.75%. Comparing base (29e830d) to head (af037ea).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #451      +/-   ##
==========================================
+ Coverage   96.52%   96.75%   +0.22%     
==========================================
  Files          27       11      -16     
  Lines        1468      954     -514     
  Branches      192      143      -49     
==========================================
- Hits         1417      923     -494     
+ Misses         47       28      -19     
+ Partials        4        3       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9261af6 and 6c12579.

📒 Files selected for processing (69)
  • autoload/denops/_internal/server/proc.vim (2 hunks)
  • deno.jsonc (1 hunks)
  • denops/@denops-private/cli.ts (1 hunks)
  • denops/@denops-private/cli_test.ts (2 hunks)
  • denops/@denops-private/deno.jsonc (1 hunks)
  • denops/@denops-private/denops.ts (1 hunks)
  • denops/@denops-private/denops_test.ts (2 hunks)
  • denops/@denops-private/error.ts (1 hunks)
  • denops/@denops-private/error_test.ts (1 hunks)
  • denops/@denops-private/host.ts (1 hunks)
  • denops/@denops-private/host/nvim.ts (1 hunks)
  • denops/@denops-private/host/nvim_test.ts (1 hunks)
  • denops/@denops-private/host/vim.ts (1 hunks)
  • denops/@denops-private/host/vim_test.ts (1 hunks)
  • denops/@denops-private/host_test.ts (1 hunks)
  • denops/@denops-private/plugin.ts (1 hunks)
  • denops/@denops-private/plugin_test.ts (1 hunks)
  • denops/@denops-private/service.ts (1 hunks)
  • denops/@denops-private/service_test.ts (1 hunks)
  • denops/@denops-private/util.ts (1 hunks)
  • denops/@denops-private/version.ts (1 hunks)
  • denops/@denops-private/version_test.ts (1 hunks)
  • denops/@denops-private/worker.ts (1 hunks)
  • denops/@denops-private/worker_test.ts (1 hunks)
  • tests/denops/runtime/functions/denops/interrupt_test.ts (1 hunks)
  • tests/denops/runtime/functions/denops/notify_test.ts (1 hunks)
  • tests/denops/runtime/functions/denops/request_async_test.ts (1 hunks)
  • tests/denops/runtime/functions/denops/request_test.ts (1 hunks)
  • tests/denops/runtime/functions/plugin/check_type_test.ts (1 hunks)
  • tests/denops/runtime/functions/plugin/discover_test.ts (1 hunks)
  • tests/denops/runtime/functions/plugin/is_loaded_test.ts (1 hunks)
  • tests/denops/runtime/functions/plugin/load_test.ts (1 hunks)
  • tests/denops/runtime/functions/plugin/reload_test.ts (1 hunks)
  • tests/denops/runtime/functions/plugin/unload_test.ts (1 hunks)
  • tests/denops/runtime/functions/plugin/wait_async_test.ts (1 hunks)
  • tests/denops/runtime/functions/plugin/wait_test.ts (1 hunks)
  • tests/denops/runtime/functions/server/close_test.ts (1 hunks)
  • tests/denops/runtime/functions/server/connect_test.ts (1 hunks)
  • tests/denops/runtime/functions/server/start_test.ts (1 hunks)
  • tests/denops/runtime/functions/server/status_test.ts (1 hunks)
  • tests/denops/runtime/functions/server/stop_test.ts (1 hunks)
  • tests/denops/runtime/plugin_test.ts (1 hunks)
  • tests/denops/testdata/dummy_dispatcher_plugin.ts (1 hunks)
  • tests/denops/testdata/dummy_interrupt_plugin.ts (1 hunks)
  • tests/denops/testdata/dummy_invalid_constraint_plugin.ts (1 hunks)
  • tests/denops/testdata/dummy_invalid_constraint_plugin2.ts (1 hunks)
  • tests/denops/testdata/dummy_invalid_dispose_plugin.ts (1 hunks)
  • tests/denops/testdata/dummy_invalid_plugin.ts (1 hunks)
  • tests/denops/testdata/dummy_invalid_wait_plugin.ts (1 hunks)
  • tests/denops/testdata/dummy_plugins/denops/@dummy_namespace/main.ts (1 hunks)
  • tests/denops/testdata/dummy_plugins/denops/dummy.invalid_name/main.ts (1 hunks)
  • tests/denops/testdata/dummy_plugins/denops/dummy_invalid/main.ts (1 hunks)
  • tests/denops/testdata/dummy_plugins/denops/dummy_valid/main.ts (1 hunks)
  • tests/denops/testdata/dummy_valid_dispose_plugin.ts (1 hunks)
  • tests/denops/testdata/dummy_valid_plugin.ts (1 hunks)
  • tests/denops/testdata/dummy_valid_wait_plugin.ts (1 hunks)
  • tests/denops/testdata/resolve.ts (1 hunks)
  • tests/denops/testdata/shared_server_test_no_verbose.ts (1 hunks)
  • tests/denops/testdata/shared_server_test_verbose_true.ts (1 hunks)
  • tests/denops/testdata/with_import_map/plugin_with_import_map.ts (1 hunks)
  • tests/denops/testutil/conf.ts (1 hunks)
  • tests/denops/testutil/conf_test.ts (1 hunks)
  • tests/denops/testutil/mock.ts (1 hunks)
  • tests/denops/testutil/mock_test.ts (1 hunks)
  • tests/denops/testutil/shared_server.ts (1 hunks)
  • tests/denops/testutil/shared_server_test.ts (1 hunks)
  • tests/denops/testutil/wait.ts (1 hunks)
  • tests/denops/testutil/wait_test.ts (1 hunks)
  • tests/denops/testutil/with.ts (1 hunks)
✅ Files skipped from review due to trivial changes (37)
  • tests/denops/runtime/functions/server/status_test.ts
  • denops/@denops-private/host.ts
  • tests/denops/runtime/functions/denops/request_async_test.ts
  • tests/denops/testutil/conf.ts
  • tests/denops/runtime/functions/plugin/discover_test.ts
  • tests/denops/testdata/dummy_valid_plugin.ts
  • tests/denops/runtime/functions/denops/interrupt_test.ts
  • tests/denops/testutil/conf_test.ts
  • denops/@denops-private/error.ts
  • tests/denops/testdata/dummy_plugins/denops/dummy_invalid/main.ts
  • tests/denops/testdata/with_import_map/plugin_with_import_map.ts
  • tests/denops/testutil/mock.ts
  • tests/denops/testdata/dummy_valid_wait_plugin.ts
  • tests/denops/runtime/functions/plugin/check_type_test.ts
  • tests/denops/testdata/dummy_invalid_wait_plugin.ts
  • tests/denops/testutil/shared_server_test.ts
  • tests/denops/runtime/functions/plugin/load_test.ts
  • denops/@denops-private/util.ts
  • tests/denops/runtime/functions/server/stop_test.ts
  • tests/denops/testutil/with.ts
  • tests/denops/runtime/functions/plugin/is_loaded_test.ts
  • denops/@denops-private/error_test.ts
  • tests/denops/testutil/wait.ts
  • tests/denops/runtime/functions/denops/notify_test.ts
  • tests/denops/runtime/functions/denops/request_test.ts
  • tests/denops/runtime/functions/plugin/wait_async_test.ts
  • tests/denops/testutil/shared_server.ts
  • denops/@denops-private/version_test.ts
  • denops/@denops-private/host_test.ts
  • tests/denops/runtime/functions/plugin/wait_test.ts
  • tests/denops/runtime/plugin_test.ts
  • tests/denops/testutil/mock_test.ts
  • tests/denops/testutil/wait_test.ts
  • tests/denops/testdata/dummy_interrupt_plugin.ts
  • tests/denops/runtime/functions/server/close_test.ts
  • tests/denops/testdata/dummy_invalid_plugin.ts
  • denops/@denops-private/plugin_test.ts
🚧 Files skipped from review as they are similar to previous changes (31)
  • tests/denops/testdata/dummy_dispatcher_plugin.ts
  • tests/denops/testdata/dummy_valid_dispose_plugin.ts
  • tests/denops/testdata/resolve.ts
  • tests/denops/testdata/dummy_invalid_constraint_plugin.ts
  • tests/denops/testdata/dummy_plugins/denops/dummy.invalid_name/main.ts
  • tests/denops/testdata/dummy_plugins/denops/@dummy_namespace/main.ts
  • tests/denops/testdata/dummy_invalid_dispose_plugin.ts
  • tests/denops/testdata/shared_server_test_verbose_true.ts
  • tests/denops/testdata/dummy_invalid_constraint_plugin2.ts
  • denops/@denops-private/host/vim.ts
  • tests/denops/testdata/shared_server_test_no_verbose.ts
  • autoload/denops/_internal/server/proc.vim
  • denops/@denops-private/denops.ts
  • denops/@denops-private/version.ts
  • tests/denops/runtime/functions/server/start_test.ts
  • denops/@denops-private/plugin.ts
  • denops/@denops-private/cli.ts
  • denops/@denops-private/deno.jsonc
  • denops/@denops-private/cli_test.ts
  • tests/denops/testdata/dummy_plugins/denops/dummy_valid/main.ts
  • denops/@denops-private/host/nvim_test.ts
  • tests/denops/runtime/functions/plugin/unload_test.ts
  • denops/@denops-private/denops_test.ts
  • tests/denops/runtime/functions/plugin/reload_test.ts
  • denops/@denops-private/host/nvim.ts
  • denops/@denops-private/host/vim_test.ts
  • denops/@denops-private/service.ts
  • tests/denops/runtime/functions/server/connect_test.ts
  • denops/@denops-private/service_test.ts
  • denops/@denops-private/worker.ts
  • denops/@denops-private/worker_test.ts
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: Milly
PR: vim-denops/denops.vim#418
File: tests/denops/runtime/functions/plugin/check_type_test.ts:6-6
Timestamp: 2024-09-14T17:09:30.174Z
Learning: In this project, import paths prefixed with `/denops-testdata/` are defined in `deno.jsonc` via an import map, and these import paths are valid.
📚 Learning: in this project, import paths prefixed with `/denops-testdata/` are defined in `deno.jsonc` via an i...
Learnt from: Milly
PR: vim-denops/denops.vim#418
File: tests/denops/runtime/functions/plugin/check_type_test.ts:6-6
Timestamp: 2024-09-14T17:09:30.174Z
Learning: In this project, import paths prefixed with `/denops-testdata/` are defined in `deno.jsonc` via an import map, and these import paths are valid.

Applied to files:

  • deno.jsonc
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: test (macos-latest, 2.x, v9.1.0448, v0.10.0)
  • GitHub Check: test (windows-latest, 2.x, v9.1.0448, v0.10.0)
  • GitHub Check: test (ubuntu-latest, 2.x, v9.1.0448, v0.10.0)
  • GitHub Check: test (macos-latest, 1.45.0, v9.1.0448, v0.10.0)
🔇 Additional comments (3)
deno.jsonc (3)

2-4: Confirm workspace key is recognised by the CI Deno version

workspace landed in Deno v1.46. Older runners will fail to parse the config with
error: Unrecognized option 'workspace' in config.
Double-check the minimum Deno version declared in CI / docs and bump it if necessary.


9-10: --coverage-raw-data-only flag requires Deno ≥ 1.44

The flag was introduced recently; using it on earlier toolchains will break the
test:coverage task. Please verify the runner version or gate the flag with a
version check.


23-33: Alias additions look good

Import-map entries are correctly version-pinned to the latest
^1.x series and follow the existing naming convention. No issues spotted.

Comment on lines +11 to +12
"update": "deno outdated --update --latest --recursive",
"update:interactive": "deno task update -- --interactive",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Avoid self-referential task invocation

update:interactive shells out to deno task update, which is fine, but you
can call deno outdated directly and forward the extra flag to simplify the
indirection:

-    "update:interactive": "deno task update -- --interactive",
+    "update:interactive": "deno outdated --update --latest --recursive --interactive",

Fewer layers → easier to debug.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"update": "deno outdated --update --latest --recursive",
"update:interactive": "deno task update -- --interactive",
"update": "deno outdated --update --latest --recursive",
"update:interactive": "deno outdated --update --latest --recursive --interactive",
🤖 Prompt for AI Agents
In deno.jsonc around lines 11 to 12, the "update:interactive" task currently
calls "deno task update" which then calls "deno outdated". To simplify and
reduce indirection, modify "update:interactive" to call "deno outdated" directly
with the "--update --latest --recursive --interactive" flags, forwarding the
interactive flag directly. This reduces layers and makes debugging easier.

@lambdalisue lambdalisue force-pushed the use-import-map-in-denops-itself branch 4 times, most recently from b97cba5 to 43dce43 Compare August 2, 2025 13:34
@lambdalisue lambdalisue force-pushed the use-import-map-in-denops-itself branch from 43dce43 to deb9e1c Compare August 2, 2025 13:34
@lambdalisue lambdalisue force-pushed the use-import-map-in-denops-itself branch from deb9e1c to af037ea Compare August 2, 2025 13:40
@lambdalisue lambdalisue merged commit 562781b into main Aug 2, 2025
14 checks passed
@lambdalisue lambdalisue deleted the use-import-map-in-denops-itself branch August 2, 2025 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants